﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;

namespace HHXX.IBLL
{
    public interface IBaseService<T> where T : class, new()
    {
        #region select
        T GetModel(int id);
        T GetModel(object id);
        IQueryable<T> GetEntities(Expression<Func<T, bool>> whereLambda);
        IQueryable<T> GetPageEntities<S>(int pageSize, int pageIndex, out int total, Expression<Func<T, bool>> whereLambda
            , Expression<Func<T, S>> orderByLambda, bool isAsc);
        #endregion

        #region cud
        T Add(T T);
        bool Update(T T);
        bool Delete(T T);
        bool IsExist(object id);
        bool Delete(int id);
        int DeleteListByLogical(List<int> ids);

        #endregion
    }
}
